<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Framebuffer object</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Framebuffer_object"> <link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Framebuffer_object rootpage-Framebuffer_object skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Framebuffer object</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><p>The <b>frame buffer object</b> architecture (FBO) is an extension to <a href="OpenGL" title="OpenGL">OpenGL</a> for doing flexible off-screen rendering, including rendering to a <a href="Texture_(computer_graphics)" class="mw-redirect" title="Texture (computer graphics)">texture</a>. By capturing images that would normally be drawn to the screen, it can be used to implement a large variety of image filters, and post-processing effects. The FBO is analogous to the <b>render targets model</b> in <a href="DirectX" title="DirectX">DirectX</a>. It is used in OpenGL for its efficiency and ease of use. The use of FBOs doesn't suffer from the overhead associated with OpenGL drawing context switching, and has largely superseded the <a href="Pbuffer" class="mw-redirect" title="Pbuffer">pbuffer</a> and other methods involving context switches.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Uses">Uses</h2></div>
<p>The FBO has two main uses: The post-processing of rendered images and composition between different scenes.
Some examples are:
</p>
<ol><li>The rendered image is captured and subjected to <a href="Fragment_Shaders" class="mw-redirect" title="Fragment Shaders">Fragment Shaders</a> or other manipulations. This allows for many of today's popular computer graphics effects to be carried out, including the addition of a blurring or bloom effect.</li>
<li>Can be used to create views of other scenes, for example: a TV in a house showing the view from a secondary camera. A scene can be rendered through an FBO to a texture, then that texture can be applied to the surface of a TV. This is sometimes called "Render to Texture" or RTT.</li></ol>
<div class="mw-heading mw-heading2"><h2 id="Advantages_over_other_methods">Advantages over other methods</h2></div>
<p>Methods involving the FBO are considered superior because:
</p>
<ul><li>It is easier to set up than most other methods.</li>
<li>Does not require context switching.</li>
<li>Is more efficient because resources are shared within the same context.</li>
<li>Is more flexible because all of <a href="Depth_buffer" class="mw-redirect" title="Depth buffer">depth buffer</a>, <a href="Stencil_buffer" title="Stencil buffer">stencil buffer</a>, etc. can be acquired.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Architecture">Architecture</h2></div>
<p>To use an FBO one simply creates an instance of it. Along with the FBO come several attachments. One can then attach these to a chosen receiver: either a <a href="Texture_(computer_graphics)" class="mw-redirect" title="Texture (computer graphics)">texture</a>, or a render buffer.
</p><p>For example:
</p>
<ul><li>Create an FBO and bind it.</li>
<li>Attach the color buffer (either as a RenderBuffer or a texture) to the FBO.</li>
<li>Attach the depth buffer (either as a RenderBuffer or a texture) to the FBO.</li>
<li>Bind the native window FrameBuffer (id=0)</li>
<li>Render the texture to screen with a pixel shader, dependent on both the Color information and depth information.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt">Framebuffer object technical paper</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20130502110335/http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt">Archived</a> 2013-05-02 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a></li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20070108122530/http://openvidia.sourceforge.net/fbo.shtml">Framebuffer object reference at openvidia</a></li>
<li><a rel="nofollow" class="external text" href="http://www.songho.ca/opengl/gl_fbo.html">Example code for Windows and Linux</a></li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20131101002803/http://www.opengl.org/wiki/GL_EXT_framebuffer_object">EXT Framebuffer</a> (opengl.org)</li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2022-11-27" href="https://en.wikipedia.org/wiki/?title=Framebuffer_object&oldid=1124064121">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>